app.controller('navController',['$scope','$window','$location','mainService',function($scope,$window,$location,mainService){
/*    var num = 11;
    $scope.headerName = '期限内未整改查询结果('+num +')'

}*/
    console.log($location.path())

    //     if($location.path()=='/yinhuanluru'){
    //         $scope.goback=function(){$location.path('/renwuxiangqing')}
    //         //todo 清空方法
    //     }else if(){
    //
    // } else{
    //         $scope.goback = function() {
    //             $window.history.back();
    //     }
    // }
    switch($location.path()){

        case '/bhgzgxq':
            $scope.headerName = '不合格整改详情';
            $scope.goback=function(){$location.path('/buhegezhenggai')};
            break;
        case '/jingqingqidai':
            $scope.headerName = '敬请期待';
            $scope.goback=function(){window.history.back()};
            break;
        case '/qixianneiweizhenggai':
            $scope.headerName = '期限内未整改查询结果';
            $scope.goback=function(){$location.path('/shouye')};
            break;
        case '/qingxianneiweizhengYhxq':
        	$scope.headerName = '隐患详情';
            $scope.goback=function(){$location.path('/qixianneiweizhenggai')};
        	break;
        case '/paicha':
            $scope.headerName = '待排查任务';
            $scope.goback=function(){$location.path('/shouye')};
            break;
        case '/renwuxiangqing':
            $scope.headerName = '任务详情';
            $scope.goback=function(){$location.path('/paicha')};
            break;
        case '/yinhuanluru' :
            $scope.headerName = '隐患录入';
            $scope.goback=function(){$location.path('/renwuxiangqing')};
            break;
        case '/yinhuanliuzhuan' :
            $scope.headerName = '隐患流转';
            $scope.goback=function(){$location.path('/renwuxiangqing')};
            break;
        case '/daiban':
            $scope.headerName = '待办';
            $scope.goback=function(){$location.path('/shouye')};
            break;
        case '/qingjiadaili':
            $scope.headerName = '请假代理';
            $scope.goback=function(){$location.path('/daiban')};
            break;
        case '/jianloushenpi':

        	$scope.headerName = '漏捡待审批';
        	break;
       	case '/shenqing':
	       	$scope.headerName = '申请信息';
	       	break;
	    case '/shenpirenyuanxuanze':
	    	$scope.headerName = '人员选择';
	    	break;
	    case '/weizhidingjihuayinhuan':

	    	$scope.headerName = '未制订计划隐患';
            $scope.goback=function(){$location.path('/daiban')};
	    	break;
	    case '/wzdjhyhxq':
	    	$scope.headerName = '未制订计划隐患详情';
            $scope.goback=function(){$location.path('/weizhidingjihuayinhuan')};
	    	break;
	    case '/renyuanxuanze':
	    	$scope.headerName = '人员选择';
            $scope.goback=function(){
                switch (mainService.getFzrtz()){
                    case 10:
                       // mainService.setyhxqFzr($event);
                        $location.path('/wzgyhxq');
                        break;
                    case 20:
                       // mainService.setFzr($event);
                        $location.path('/bhgzgxq');
                        break;
                    case 101:
                        //mainService.setFzr($event.staffName);
                        $location.path('/wzdjhyhxq');
                        break;
                    case 102:
                        //mainService.setFzr($event.staffName);
                        $location.path('/wzgyhxq');
                        break;
                    case 103:
                        //mainService.setFzr($event.staffName);
                        $location.path('/daiyanshouyinhuan');
                        break;
                    case 104:
                        //mainService.setFzr($event.staffName);
                        $location.path('/bhgzgxq');
                        break;
                    case 105:
                        //mainService.setFzr($event.staffName);
                        $location.path('/wzdjhyhxq');
                        break;
                    case 106:
                        $location.path('/loujianshenqingPage');
                }
                };
	    	break;
        case '/yinhuanchangsuo':
            $scope.headerName = '隐患场所';
            if(mainService.getData().page=='luru'){
                $scope.goback=function(){$location.path('/yinhuanluru')};
            }else {
                $scope.goback=function(){$location.path('/yinhuanliuzhuan')};
            }
            break;
        case '/liuzhuanyinhuanchangsuo':
            $scope.headerName = '隐患场所';
            $scope.goback=function(){$location.path('/yinhuanliuzhuan')};
            break;
        case '/yingjiyuan' :
            $scope.headerName = '应急预案';
            $scope.goback=function(){$location.path('/yinhuanluru')};
            break;
		case '/weizenggaiyinhuan' :
			$scope.headerName = '未整改隐患';
            $scope.goback=function(){$location.path('/daiban')};
			break;
        case '/fuzeren' :
            $scope.headerName = '负责人';
            if(mainService.getData().page=='luru'){
                $scope.goback=function(){$location.path('/yinhuanluru')};
            }else if(mainService.getData().incoming=='zhipai'){
                $scope.goback=function(){$location.path('/liuzhuandaichuliyinhuanziye')};
            }else if(mainService.getData().incoming=='liuzhuan'){
                $scope.goback=function(){$location.path('/liuzhuandaichuliyinhuanziye           ')};
            }
            else {
                $scope.goback=function(){$location.path('/yinhuanliuzhuan')};
            }

            break;

        case '/liuzhuanfuzeren' :
            $scope.headerName = '负责人';
            $scope.goback=function(){$location.path('/yinhuanliuzhuan')};
            break;
		case '/wzgyhxq':
			$scope.headerName = '未整改隐患详情';
            $scope.goback=function(){$location.path('/weizenggaiyinhuan')};

            break;
        case '/buhegezhenggai':
			$scope.headerName = '不合格整改';
            $scope.goback=function(){$location.path('/daiban')};
			break;
		case '/duban':
			var dubanName = 5;
			$scope.headerName = '督办查询结果('+dubanName+')';
			break
		case '/dubanyinhuanXq':
			$scope.headerName = '隐患详情';
			break;
        case '/lishirenwu':
            $scope.headerName = '历史任务';
            break;
        case '/baogao':
            $scope.headerName = '报告';
            break;
        case '/yinhuanchaxun':
            $scope.headerName = '隐患查询';
            break;
        case '/tongjifenxi':
            $scope.headerName = '个人隐患排查';
            break;
        case '/xitongshezhi':
            $scope.headerName = '系统设置';
            $scope.goback=function(){$location.path('/wode')};
            break;
        case '/chakanqushitu':
            $scope.headerName = '查看趋势图';
            $scope.goback=function(){$location.path('/shouye')};
            break;
        case '/daiyanshouyinhuan':
            $scope.headerName = '待验收隐患';
            $scope.goback=function(){$location.path('/daiban')};
            break;
        case '/daizhipaiduban':
            $scope.headerName = '待指派督办';
            $scope.goback=function(){$location.path('/daiban')};
            break;
        case '/daidubanyinhuan':
            $scope.headerName = '待督办隐患';
            $scope.goback=function(){$location.path('/daiban')};
            break;
        case '/liuzhuandaichuliyinhuan':
            $scope.headerName = '流转待处理隐患';
            $scope.goback=function(){$location.path('/daiban')};
            break;
        case '/loujiandaishenqing':
            $scope.headerName = '漏检待申请';
            $scope.goback=function(){$location.path('/daiban')};
            break;
        case '/loujiandaishenpi':
            $scope.headerName = '漏检待审批';
            $scope.goback=function(){$location.path('/daiban')};
            break;
        case '/liuzhuandaichuliyinhuanxiangqing':
             $scope.headerName = '流转待处理隐患详情';
             $scope.goback=function(){$location.path('/liuzhuandaichuliyinhuan')};
                    break;
        case '/loujianshenqingPage':
             $scope.headerName = '申请信息';
             $scope.goback=function(){$location.path('/loujiandaishenqing')};
                    break;
        case '/liuzhuandaichuliyinhuanziye':
             $scope.headerName = '流转待处理隐患子页';
             $scope.goback=function(){$location.path('/liuzhuandaichuliyinhuanxiangqing')};
                    break;
        case '/daizhipaidubanxiangqing':
             $scope.headerName = '待指派督办详情';
             $scope.goback=function(){$location.path('/daizhipaiduban')};
                    break;
        case '/daidubanyinhuanxiangqing':
             $scope.headerName = '待指派督办详情';
             $scope.goback=function(){$location.path('/daidubanyinhuan')};
                    break;


       }
}]);

/*app.controller('navController',['$scope','$window',function($scope,$window){
    $scope.headerName = '待办'
    $scope.goback = function(){
        $window.history.back();
}
}]);*/
